package com.fantasy.springboot.controller;

import com.fantasy.springboot.Bean.PersonInfo;
import com.fantasy.springboot.Bean.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class IndexController {

    @Resource
    private User user;

    @Resource
    private PersonInfo personInfo;

    @RequestMapping("/")
    String index () {
        return user.getUsername() + user.getGender();
    }

    @RequestMapping("/info")
    String info () {
        return personInfo.getUsername() + personInfo.getHome();
    }
}
